﻿Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
Imports System.Data.Common
Imports Microsoft.SqlServer
Public Class DLGPPersonal
#Region "Consultar"
    'Funcion que carga la Lista de Categorias del Personal
    'fecha crea         fecha modifica         autor
    '01/02/2012         01/02/2012              JKP
    Public Function fuDLListarCategoria() As DataTable
        Try
            Using lCnx As New SqlConnection(ConfigurationManager.ConnectionStrings("GPConnectionString").ConnectionString)
                Dim lCmd As New SqlCommand("paGPCategoriaLST", lCnx)
                lCmd.CommandType = CommandType.StoredProcedure
                Dim lDa As New SqlDataAdapter
                lDa.SelectCommand = lCmd
                'Llenar el dataset
                Dim lDs As New DataSet
                lDa.Fill(lDs)
                'retornar datos
                Return lDs.Tables(0)
            End Using
        Catch ex As SqlClient.SqlException
            Throw New ArgumentException("Descripcion : " & ex.Message)
        End Try
    End Function

    Public Function fuDLBuscarPersonalx(ByVal piPerPersonalID As Integer) As DataTable
        Using lCnx As New SqlConnection(ConfigurationManager.ConnectionStrings("GPConnectionString").ConnectionString)
            Dim lCmd As New SqlCommand("paGPPersonalBUSx", lCnx)
            lCmd.CommandType = CommandType.StoredProcedure
            lCmd.Parameters.Add("@perPersonalID", SqlDbType.Int).Value = piPerPersonalID
            Dim lDa As New SqlDataAdapter
            lDa.SelectCommand = lCmd
            'Llenar el dataset
            Dim lDs As New DataSet
            lDa.Fill(lDs)
            'retornar datos
            Return lDs.Tables(0)
        End Using
    End Function



#End Region
#Region "Actualizar"
    'Funcion que actualiza alguna tarea
    'fecha crea         fecha modifica         autor
    '01/02/2012         01/02/2012              JKP


#End Region
End Class

